chore: reorganize tsconfig files for clarity - #257
Conversation
b58adfc to
a754be9
Compare
| /** | ||
| * Unlike Snap's which include all TypeScript, TSX and JSON files, here we want | ||
| * to mirror what gets built. | ||
| */ | ||
| "include": ["./src"] |
There was a problem hiding this comment.
curious about why was this change needed
There was a problem hiding this comment.
Same as before, removing the unused types entry and the exclude is inherited from the shared tsconfig's above
| /** | ||
| * Unlike Snap's which include all TypeScript, TSX and JSON files, here we want | ||
| * to mirror what gets built. | ||
| */ | ||
| "include": ["./src"] |
There was a problem hiding this comment.
curious about why was this change needed
There was a problem hiding this comment.
However I have realized one thing. Instead of specifying what we want included, I think it would be best to specify what we exclude because if in the future we add a scripts folder inside here or if we change some config files to use TS instead of JS, we want to already be typechecking those.
There was a problem hiding this comment.
This last comment does not apply to the build though. For the build we want to specify exactly what is being included and therefore being include-first is the best approach to avoid shipping bloat in the package.
There was a problem hiding this comment.
Also the precious line, which add a ../../types was pointing to something that didn't exist 😅
748bb61 to
17ebfdd
Compare
|
Hi @ulissesferreira, spotted this comment in the core PR MetaMask/core#10019 it is related to the target ES2023, which is not supported in ReactNative, maybe it is irrelevant for snaps, but worth checking |
17ebfdd to
427d4b6
Compare
Thank you for the thoughtfulness! As part of this work I am asking the Snaps team to have a look and tell us if they like the configurations for Snaps. For our library package I guess the same thing kind of applies. I was expecting whatever bundler used by the clients to handle that actually, kinda surprised Core has to be the repository that implements that. |
effb589 to
8a31ec9
Compare
| }, | ||
| "files": [], | ||
| "include": ["./docs", "./tests", "./scripts"], | ||
| "exclude": ["**/node_modules"] |
There was a problem hiding this comment.
This is already a tsc default, unnecessary.
| "locales/*.json", | ||
| "snap.manifest.json", | ||
| "src/**/*.json" | ||
| ] |
8a31ec9 to
42d9b09
Compare

Explanation
One more clarity improving PR for the
tsconfigfiles on our repository so anyone can understand what is happening under the hood and keeping as many similarities as possible withcore. The hierarchy of the config files is explained below but I believe that with their names and comments inside it should be self explanatory. Please raise if this is not extremely intuitive.References
Checklist